// 订单模型
const { Orders } = require('../../../models/order');

// 统一数据返回类
const { DataReturn } = require('../../../common/returnclass');

module.exports = async (req, res) => {
	let { _id ,is_send } = req.fields;
	console.log(req.fields);
	
	// 更新地址信息 发货后改为待收货状态 2
	Orders.updateOne({_id}, {is_send:is_send,state:2})
	.then(()=>{
		DataReturn.getData(res,200,[],'发货成功')
	}).catch(()=>{
		DataReturn.getData(res,400,[],'发货失败')
	})


}